CentOS 7
Sponsored Link

PostgreSQL 9.5 : Install phpPgAdmin
2016/08/30
 
Install phpPgAdmin to operate PostgreSQL on web browser from Client hosts.
[1]
[2]
[3] Install phpPgAdmin.
# install from EPEL

[root@dlp ~]#
yum --enablerepo=epel -y install phpPgAdmin php-pgsql
[root@dlp ~]#
vi /etc/phpPgAdmin/config.inc.php
# line 18: add

$conf['servers'][0]['host'] = '
localhost
';
# line 35: change

$conf['servers'][0]['pg_dump_path'] = '
/opt/rh/rh-postgresql95/root/usr/bin/pg_dump
';
$conf['servers'][0]['pg_dumpall_path'] = '
/opt/rh/rh-postgresql95/root/usr/bin/pg_dumpall
';
# line 93: change to false if you allow to login with priviledged user like postgres, root

$conf['extra_login_security'] =
false
;
# line 99: change

$conf['owned_only'] =
true
;
[root@dlp ~]#
vi /var/opt/rh/rh-postgresql95/lib/pgsql/data/pg_hba.conf
# line 82: change like follows and add access permission

host    all         all         127.0.0.1/32          md5
host    all         all         10.0.0.0/24           md5
host    all         all         ::1/128               md5

[root@dlp ~]#
vi /etc/httpd/conf.d/phpPgAdmin.conf
# line 11: add access permission

Require local
Require ip 10.0.0.0/24
[root@dlp ~]#
systemctl restart httpd rh-postgresql95-postgresql

[4] If SELinux is enabled, change boolean setting.
[root@dlp ~]#
setsebool -P httpd_can_network_connect_db on

[5] Access to the "http://(hostname or IP address)/phpPgAdmin/" and click "PostgreSQL" on the left menu.
[6] Autenticate a user and password which is in PostgreSQL.
[7] Just logined. You can operate PostgreSQL on here.
 
Tweet